﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Delegate
{
    public partial class Infor : UserControl
    {
        public Infor()
        {
            InitializeComponent();
            this.Name = "info";
        }
        public delegate void set(string a);
        
        private void button1_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            this.Enabled = false;
            Control[] list = this.Parent.Controls.Find("request", true);
            Control result = null;

            if (list.Length != 0)
            {
                result = list[0];
                result.Visible = true;
                result.Enabled = true;
                request a = (request)result;
                
                set pass = new set(a.set);

                pass(textBox1.Text);
                
            }
        }
    }
}
